package xjggb.algorithm.集合;

import java.util.concurrent.*;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;

public class ApplicationLIst {
    public static void main(String[] args) {
        ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor(
                2,  //核心线程池大小
                5, //最大核心线程池大小
                2, //超时没有调用就会释放
                TimeUnit.SECONDS,  //超时单位
                new LinkedBlockingDeque<>(3), //线程工厂，一般不修改
                new ThreadPoolExecutor.DiscardOldestPolicy()  //一种拒绝策略（队列满了，尝试和最早的去竞争，也不会抛出异常）
        );

        Lock reentrantLock = new ReentrantLock(false);
        reentrantLock.lock();

        reentrantLock.unlock();



        threadPoolExecutor.execute(()->{

        });

    }
}
